package com.song.polo;

import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**ajxa返回前端信息对象
 * @author song
 */
@Component
public class AjxaResultMessage <T> {
    //返回值的状态码 200 201 404 500
    private Integer status;
    //返回的信息 错误或异常
    private String message;
    //返回集合
    private List<T> list;
    //返回对象
    private T object;

    public Map getMap() {
        return map;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    private Map map;

    public AjxaResultMessage(Integer status, String message, Map map) {
        this.status = status;
        this.message = message;
        this.map = map;
    }

    public AjxaResultMessage(Integer status) {
        this.status = status;
    }

    public AjxaResultMessage(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public AjxaResultMessage() {
    }

    public AjxaResultMessage(Integer status, String message, List<T> list, T object) {
        this.status = status;
        this.message = message;
        this.list = list;
        this.object = object;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }
}
